//
//  YBDetailPayPopView.swift
//  Moonlight
//
//  Created by 清风徐来 on 2023/11/6.
//  Copyright © 2023 Moonlight Game Streaming Project. All rights reserved.
//

import UIKit
import SwifterSwift
import zhPopupController
import SDWebImage

class YBDetailPayPopView: UIView {

    @IBOutlet weak var coverimg: UIImageView!

    static var popVc : zhPopupController?

    @IBAction func comfimAction(_ sender: Any) {
        YBMessagePopView.dismiss()
    }

    override func awakeFromNib() {
        super.awakeFromNib()

        self.bk_cornerRadius = 10
        self.clipsToBounds = true
    }

    static func show(model: YBMessageModel) {
        guard let view: YBDetailPayPopView = YBDetailPayPopView.loadFromNib(named: "YBDetailPayPopView") as? YBDetailPayPopView else { return }
        view.coverimg.sd_setImage(with: URL(string: model.coverImg))

        Self.popVc = zhPopupController(view: view, size: .init(width: kScreenWidth - 40, height: kScreenHeight * 0.52))
        Self.popVc?.dismissOnMaskTouched = false
        Self.popVc?.show()
    }

    static func dismiss() {
        Self.popVc?.dismiss()
        Self.popVc = nil
    }
}
